package com.itic.ht.mem.orderdetail.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.itic.appbase.framework.common.service.HtCrudService;
import com.itic.ht.mem.order.persistence.dao.MemberOrderDao;
import com.itic.ht.mem.orderdetail.persistence.dao.MemberOrderDetailDao;
import com.itic.ht.mem.orderdetail.persistence.model.MemberOrderDetail;
import com.itic.ht.mem.orderdetail.persistence.model.MemberOrderDetailExample;


@Service
@Transactional
public class MemberOrderDetailService
     extends HtCrudService<MemberOrderDetailDao,MemberOrderDetail,MemberOrderDetailExample> {
    @Autowired
    private MemberOrderDetailDao memberOrderDetailDao;

	public MemberOrderDetail getMemOrderDetailByOrderNum(String orderNum) {
		MemberOrderDetailExample example = new MemberOrderDetailExample();
		example.createCriteria().andOrderNumEqualTo(orderNum);
		List<MemberOrderDetail> list = memberOrderDetailDao.selectByExample(example);
		if(null!=list&&list.size()>0){
			MemberOrderDetail memberOrderDetail = new MemberOrderDetail();
			memberOrderDetail=list.get(0);
			return memberOrderDetail;
		}
		return null;
	}


}